package com.sz.biz.logistics.ord.entity;

import com.sz.common.base.dao.ext.IEnum;

/**
 * Function: 订单的状态 <br>
 * Author: hpeng.wang <br>
 * Date: 2017-04-24 17:03:00
 */
public enum OrderStatus implements IEnum {

    /**
     * 草稿
     * 已提交
     * 已受理
     * 已收货
     * 运输中
     * 配送中
     * 已签收
     */
    DRAFT("101", "草稿"),
    COMMITED("102", "已提交"),
    ACCEPT("103", "已受理"),
    RECEGOOD("104", "已收货"),
    TRANSPORT("105", "运输中"),
    DISPACTCHING("106", "配送中"),
    RECEIVED("107", "已签收");


    private String code;
    private String name;

    OrderStatus(String code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static OrderStatus valueOfEnum(String code) {
        OrderStatus[] iss = values();
        for (OrderStatus cs : iss) {
            if (cs.getCode().equals(code)) {
                return cs;
            }
        }
        return null;
    }


}
